//
//  UIApplication+IQKeyboardManager.swift
//  
//
//  Created by tangbl93 on 2021/1/5.
//
import UIKit

#if canImport(IQKeyboardManagerSwift)
import IQKeyboardManagerSwift

public extension UIApplication {
    
    /// Init & Adjust
    static func yx_adjustIQKeyboardManager(toolbarTintColor:UIColor? = nil,
                                           disabledClasses:[UIViewController.Type] = []) {
        IQKeyboardManager.shared.enable = true

        // apply toolbarTintColor to IQKeyboardManager
        IQKeyboardManager.shared.toolbarTintColor = toolbarTintColor
        
        // add all disabled classes
        IQKeyboardManager.shared.disabledDistanceHandlingClasses.append(contentsOf: disabledClasses)
    }
}
#endif
